package com.ruoyi.charging.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.charging.mapper.ChargingCostRuleMapper;
import com.ruoyi.charging.domain.ChargingCostRule;
import com.ruoyi.charging.service.IChargingCostRuleService;

/**
 * 计费规则Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-13
 */
@Service
public class ChargingCostRuleServiceImpl implements IChargingCostRuleService 
{
    @Autowired
    private ChargingCostRuleMapper chargingCostRuleMapper;

    /**
     * 查询计费规则
     * 
     * @param id 计费规则主键
     * @return 计费规则
     */
    @Override
    public ChargingCostRule selectChargingCostRuleById(Long id)
    {
        return chargingCostRuleMapper.selectChargingCostRuleById(id);
    }

    /**
     * 查询计费规则列表
     * 
     * @param chargingCostRule 计费规则
     * @return 计费规则
     */
    @Override
    public List<ChargingCostRule> selectChargingCostRuleList(ChargingCostRule chargingCostRule)
    {
        return chargingCostRuleMapper.selectChargingCostRuleList(chargingCostRule);
    }

    /**
     * 新增计费规则
     * 
     * @param chargingCostRule 计费规则
     * @return 结果
     */
    @Override
    public int insertChargingCostRule(ChargingCostRule chargingCostRule)
    {
        return chargingCostRuleMapper.insertChargingCostRule(chargingCostRule);
    }

    /**
     * 修改计费规则
     * 
     * @param chargingCostRule 计费规则
     * @return 结果
     */
    @Override
    public int updateChargingCostRule(ChargingCostRule chargingCostRule)
    {
        return chargingCostRuleMapper.updateChargingCostRule(chargingCostRule);
    }

    /**
     * 批量删除计费规则
     * 
     * @param ids 需要删除的计费规则主键
     * @return 结果
     */
    @Override
    public int deleteChargingCostRuleByIds(Long[] ids)
    {
        return chargingCostRuleMapper.deleteChargingCostRuleByIds(ids);
    }

    /**
     * 删除计费规则信息
     * 
     * @param id 计费规则主键
     * @return 结果
     */
    @Override
    public int deleteChargingCostRuleById(Long id)
    {
        return chargingCostRuleMapper.deleteChargingCostRuleById(id);
    }
}
